In [351]:
file = '/Users/schriste/Downloads/AC_H1_EPM_201008.txt'

In [352]:
import pandas
from datetime import datetime
import matplotlib.pyplot as plt
%matplotlib inline

In [353]:
col_names = ['FP6P_.761-1.22MEV_IONS', 'FP7P_1.22-4.97MEV_IONS', 'UNC_FP6P_.761-1.22MEV_IONS', 'UNC_FP7P_1.22-4.97MEV_IONS']
names = ['date', 'hour'] + col_names
data = pandas.read_csv(file, skiprows=74, delim_whitespace=True, names = names)

In [354]:
data


Out[354]:
date hour FP6P_.761-1.22MEV_IONS FP7P_1.22-4.97MEV_IONS UNC_FP6P_.761-1.22MEV_IONS UNC_FP7P_1.22-4.97MEV_IONS
0 01-08-2010 00:05:00.000 0.603660 0.144420 0.174080 0.124510
1 01-08-2010 00:10:00.000 0.889020 0.126950 0.143440 0.132800
2 01-08-2010 00:15:00.000 0.424750 0.135010 0.207520 0.128780
3 01-08-2010 00:20:00.000 1.02620 0.129640 0.133510 0.131420
4 01-08-2010 00:25:00.000 0.735360 0.129640 0.157720 0.131420
5 01-08-2010 00:30:00.000 0.713410 0.126280 0.160130 0.133160
6 01-08-2010 00:35:00.000 0.779260 0.147100 0.153210 0.123370
7 01-08-2010 00:40:00.000 0.751830 0.132330 0.155980 0.130080
8 01-08-2010 00:45:00.000 0.943900 0.122920 0.139210 0.134960
9 01-08-2010 00:50:00.000 0.795730 0.116200 0.151620 0.138810
10 01-08-2010 00:55:00.000 0.795730 0.0987410 0.151620 0.150580
11 01-08-2010 01:00:00.000 0.828660 0.115530 0.148580 0.139210
12 01-08-2010 01:05:00.000 1.22930 0.0973970 0.121990 0.151620
13 01-08-2010 01:10:00.000 0.806700 0.122250 0.150580 0.135330
14 01-08-2010 01:15:00.000 0.943900 0.158520 0.139210 0.118850
15 01-08-2010 01:20:00.000 0.867070 0.156510 0.145250 0.119610
16 01-08-2010 01:25:00.000 1.03720 0.137030 0.132800 0.127830
17 01-08-2010 01:30:00.000 0.905480 0.152480 0.142130 0.121180
18 01-08-2010 01:35:00.000 0.867070 0.0994120 0.145250 0.150080
19 01-08-2010 01:40:00.000 1.09760 0.150460 0.129100 0.121990
20 01-08-2010 01:45:00.000 0.773780 0.145090 0.153750 0.124230
21 01-08-2010 01:50:00.000 0.675000 0.161880 0.164620 0.117610
22 01-08-2010 01:55:00.000 1.03720 0.191440 0.132800 0.108150
23 01-08-2010 02:00:00.000 1.30610 0.153150 0.118340 0.120910
24 01-08-2010 02:05:00.000 0.823170 0.154490 0.149070 0.120390
25 01-08-2010 02:10:00.000 0.828660 0.130310 0.148580 0.131080
26 01-08-2010 02:15:00.000 0.768290 0.123590 0.154300 0.134600
27 01-08-2010 02:20:00.000 0.943900 0.127620 0.139210 0.132450
28 01-08-2010 02:25:00.000 1.00980 0.135680 0.134600 0.128460
29 01-08-2010 02:30:00.000 0.943900 0.108820 0.139210 0.143440
30 01-08-2010 02:35:00.000 0.878050 0.128300 0.144340 0.132110
31 01-08-2010 02:40:00.000 0.998780 0.138370 0.135330 0.127200
32 01-08-2010 02:45:00.000 0.773780 0.139720 0.153750 0.126590
33 01-08-2010 02:50:00.000 0.916460 0.130980 0.141280 0.130740
34 01-08-2010 02:55:00.000 0.828660 0.105460 0.148580 0.145710
35 01-08-2010 03:00:00.000 0.735360 0.147100 0.157720 0.123370
36 01-08-2010 03:05:00.000 0.658530 0.125610 0.166670 0.133510
37 01-08-2010 03:10:00.000 0.905480 0.126950 0.142130 0.132800
38 01-08-2010 03:15:00.000 0.746340 0.122250 0.156560 0.135330
39 01-08-2010 03:20:00.000 0.790240 0.135010 0.152140 0.128780
40 01-08-2010 03:25:00.000 0.834140 0.101430 0.148090 0.148580
41 01-08-2010 03:30:00.000 0.751830 0.118220 0.155980 0.137620
42 01-08-2010 03:35:00.000 0.878050 0.172630 0.144340 0.113890
43 01-08-2010 03:40:00.000 0.910970 0.151130 0.141710 0.121720
44 01-08-2010 03:45:00.000 0.724390 0.143070 0.158910 0.125100
45 01-08-2010 03:50:00.000 0.795730 0.118220 0.151620 0.137620
46 01-08-2010 03:55:00.000 0.828660 0.101430 0.148580 0.148580
47 01-08-2010 04:00:00.000 0.889020 0.147100 0.143440 0.123370
48 01-08-2010 04:05:00.000 1.11400 0.135010 0.128140 0.128780
49 01-08-2010 04:10:00.000 1.05370 0.141730 0.131760 0.125690
50 01-08-2010 04:15:00.000 1.02620 0.137030 0.133510 0.127830
51 01-08-2010 04:20:00.000 1.01520 0.116880 0.134230 0.138410
52 01-08-2010 04:25:00.000 1.08110 0.126280 0.130080 0.133160
53 01-08-2010 04:30:00.000 1.01520 0.120910 0.134230 0.136080
54 01-08-2010 04:35:00.000 0.889020 0.144420 0.143440 0.124510
55 01-08-2010 04:40:00.000 0.976820 0.116880 0.136840 0.138410
56 01-08-2010 04:45:00.000 0.696950 0.130980 0.162010 0.130740
57 01-08-2010 04:50:00.000 0.905480 0.127620 0.142130 0.132450
58 01-08-2010 04:55:00.000 0.856090 0.110830 0.146180 0.142130
59 01-08-2010 05:00:00.000 0.751830 0.104110 0.155980 0.146650
... ... ... ... ... ...

8930 rows × 6 columns

the last few lines in the file need to be removed


In [355]:
data = data.truncate(after=len(data)-5)

now create the time indices


In [356]:
times = [datetime.strptime(t[0:-4], '%d-%m-%Y %H:%M:%S') for t in data['date'] + ' ' + data['hour']]

add this array to the dataFrame and set it as the index


In [357]:
data['times'] = times
data = data.set_index('times')

now drop the no longer need columns


In [358]:
data = data.drop('hour',1)
data = data.drop('date',1)

for some reasons the data is not being parsed properly as floats


In [359]:
data.dtypes


Out[359]:
FP6P_.761-1.22MEV_IONS        object
FP7P_1.22-4.97MEV_IONS        object
UNC_FP6P_.761-1.22MEV_IONS    object
UNC_FP7P_1.22-4.97MEV_IONS    object
dtype: object

convert those to floats and replace them


In [360]:
for col in col_names:
    data[col] = data[col].convert_objects(convert_numeric=True)

In [361]:
data.dtypes


Out[361]:
FP6P_.761-1.22MEV_IONS        float64
FP7P_1.22-4.97MEV_IONS        float64
UNC_FP6P_.761-1.22MEV_IONS    float64
UNC_FP7P_1.22-4.97MEV_IONS    float64
dtype: object

In [362]:
plt.figure()
data['UNC_FP7P_1.22-4.97MEV_IONS'].plot()
plt.show()


now need to remove the bad values


In [363]:
data['UNC_FP7P_1.22-4.97MEV_IONS'].min()


Out[363]:
-9.9999999999999996e+30

In [364]:
for col in col_names:
    data[col][data[col] < 0] = np.nan

In [365]:
data[col_names[0]].min()


Out[365]:
0.42475000000000002

In [372]:
plt.figure()
data.plot(subplots=True, figsize=(10, 10))
plt.show()


<matplotlib.figure.Figure at 0x107b27c50>

In [366]: